package main

import (
	"github.com/julienschmidt/httprouter"
	"net/http"
)

func RegisterHandler() * httprouter.Router{
	router := httprouter.New()
	router.GET("/",homeHandler)
	router.POST("/",homeHandler)
	router.GET("/userhome",userHomeHandler)
	router.POST("/userhome",userHomeHandler)
	router.POST("/api",apiHandler)  /**  api透传 */
	router.GET("/videos/:vid-id",proxyVideoHandler)
	router.POST("/upload/:vid-id",proxyUploadHandler)/**  api代理发送 */
	router.ServeFiles("/statics/*filepath",http.Dir("./template"))
	return  router
}

func main(){
	r := RegisterHandler()
	http.ListenAndServe(":8080",r)

}






